package com.multi.thread.chapter03.demo15;

/**
 *	join(long)参数是设定等待的时间
 */
public class JoinLongTest extends Thread {
	
	@Override
	public void run() {
		try {
			System.out.println("begin timer = " + System.currentTimeMillis());
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) throws InterruptedException {
		JoinLongTest thread = new JoinLongTest();
		thread.start();
		thread.join(2000);
		System.out.println("end timer = " + System.currentTimeMillis());
	}

}
